{% load staticfiles %}
{% load blog_tags %}

<!DOCTYPE html>
<html>
<head>
    <title>旅途</title>

    <!-- meta -->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- css -->
    <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
    <link rel="stylesheet" href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
    <link rel="stylesheet" href="{% static 'css/pace.css' %}">
    <link rel="stylesheet" href="{% static 'css/custom.css' %}">

    <!-- js -->
    <script src="{% static 'js/jquery-2.1.3.min.js' %}"></script>
    <script src="{% static 'js/bootstrap.min.js' %}"></script>
    <script src="{% static 'js/pace.min.js' %}"></script>
    <script src="{% static 'js/modernizr.custom.js' %}"></script>
</head>

<body>
<div class="container">
    <header id="site-header">
        <div class="row">
            <div class="col-md-4 col-sm-5 col-xs-8">
                <div class="logo">
                    <h1><a href="{% url 'index' %}">旅途</a></h1>
                </div>
            </div><!-- col-md-4 -->
            <div class="col-md-8 col-sm-7 col-xs-4">
                <nav class="main-nav" role="navigation">
                    <div class="navbar-header">
                        <button type="button" id="trigger-overlay" class="navbar-toggle">
                            <span class="ion-navicon"></span>
                        </button>
                    </div>

                    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                        <ul class="nav navbar-nav navbar-right">
                            <li class="cl-effect-11"><a href="{% url 'index' %}" data-hover="首页">首页</a></li>
                            <li class="cl-effect-11"><a href="{% url 'about' %}" data-hover="关于">关于</a></li>
                        </ul>
                    </div><!-- /.navbar-collapse -->
                </nav>
{#                <div id="header-search-box">#}
{#                    <a id="search-menu" href="#"><span id="search-icon" class="ion-ios-search-strong"></span></a>#}
{#                    <div id="search-form" class="search-form">#}
{#                        <form role="search" method="get" id="searchform" action="{% url 'haystack_search' %}">#}
{#                            <input type="search" placeholder="搜索" required>#}
{#                            <button type="submit"><span class="ion-ios-search-strong"></span></button>#}
{#                        </form>#}
{#                    </div>#}
{#                </div>#}
            </div><!-- col-md-8 -->
        </div>
    </header>
</div>

<div class="copyrights">旅途.com</div>

<div class="content-body">
    <div class="container">
        <div class="row">
            <main class="col-md-8">
                {% for article in post %}
                <article class="post post-{{ article.id }}">
                    <header class="entry-header">
                        <h1 class="entry-title">
                            <a href="{% url 'detail' article.id %}">{{ article.title }}</a>
                        </h1>
                        <div class="entry-meta">
                            <span class="post-category"><a href="#">{{ article.category }}</a></span>
                            <span class="post-date"><a href="#"><time class="entry-date" datetime="{{ article.add_time }}">{{ article.add_time }}</time></a></span>
                            <span class="post-author"><a href="#">{{ article.author }}</a></span>
                            <span class="comments-link"><a href="#">{{ article.comment_set.count }} 评论</a></span>
                            <span class="views-count"><a href="#">{{ article.view_nums }} 阅读</a></span>
                        </div>
                    </header>
                    <div class="entry-content clearfix">
                        <p>{{ article.summary }}</p>
                        <div class="read-more cl-effect-14">
                            <a href="{% url 'detail' article.id %}" class="more-link">继续阅读 <span class="meta-nav">→</span></a>
                        </div>
                    </div>
                </article>
                {% empty %}
                    <div class="no-post">暂无文章</div>
                {% endfor %}

                <!-- 简单分页 -->
                <p>
                    {% for page_number in post.paginator.page_range %}
                        {% ifequal page_number post.number%}
                            <u class="cl-effect-11"><font size="5">{{ page_number }}</font></u>
                        {% else %}
                            <font size="5"><a href="?page={{ page_number }}">{{ page_number }}</a></font>
                        {% endifequal %}
                    {% endfor %}

                </p>


            </main>
            <aside class="col-md-4">
                <div class="widget widget-recent-posts">
                    <h3 class="widget-title">最新文章</h3>
                {% get_recent_article as recent_post_list %}
                    {% for article in recent_post_list %}
                    <ul>
                        <li>
                            <a href="{% url 'detail' article.id %}">{{ article.title }}</a>
                        </li>
                    </ul>
                    {% empty %}
                        <div class="no-post">暂无文章</div>
                    {% endfor %}
                </div>
                <div class="widget widget-archives">
                    <h3 class="widget-title">归档</h3>
                {% get_archives as archives_list %}
                    {% for article_date in archives_list %}
                    <ul>
                        <li>
                            <a href="{% url 'archives' article_date.year article_date.month %}">{{ article_date.year }} 年 {{ article_date.month }} 月</a>
                        </li>
                    </ul>
                    {% empty %}
                    <div class="no-post">暂无归档</div>
                    {% endfor %}
                </div>

                <div class="widget widget-category">
                    <h3 class="widget-title">分类</h3>
                {% get_category as category_list %}
                    {% for article_category in category_list %}
                    <ul>
                        <li>
                            <a href="{% url 'category' article_category.id %}">{{ article_category.name }}<span class="post-count">({{ article_category.article_set.count }})</span></a>
                        </li>
                    </ul>
                    {% empty %}
                    <div class="no-post">暂无归档</div>
                    {% endfor %}
                </div>
                <div class="widget widget-category">
                    <iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=22822506&auto=0&height=66"></iframe>
                </div>
            </aside>
        </div>
    </div>
</div>
<footer id="site-footer">
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <p class="copyright">&copy; Internet</p>
            </div>
        </div>
    </div>
</footer>

<!-- Mobile Menu -->
<div class="overlay overlay-hugeinc">
    <button type="button" class="overlay-close"><span class="ion-ios-close-empty"></span></button>
    <nav>
        <ul>
            <li><a href="{% url 'index' %}">首页</a></li>
            <li><a href="full-width.html">博客</a></li>
            <li><a href="about.html">关于</a></li>
            <li><a href="contact.html">联系</a></li>
        </ul>
    </nav>
</div>

<script src="{% static 'js/script.js' %}"></script>

</body>
</html>
